<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案件处理过程</title>
    <link rel="stylesheet" href="../../lib/layui/css/layui.css">
</head>

<style>
    .processEnclosure{
        margin-top: 10px;
    }
    .layui-timeline-item{
        padding-bottom: 40px;
    }
</style>

<body>
<div style="background-color:#3399ff;border-bottom:5px solid #ffcc00;height: 30px;line-height:30px;padding-left:10px;font-size: 16px;">
    <p style="color: #ffffff;">催办记录(共<span id="processCount">0</span>条)</p>

</div>

<div style="background-color:#fdfdfd;margin-top: 10px;padding-top: 20px;">
    <ul class="layui-timeline" id="timeline">
    </ul>
    <div style="height: 50px;"></div>
</div>

</body>

<script src="../../lib/layui/layui.js"></script>
<script src="../../js/jquery.min.js"></script>
<script src="../../js/application.js"></script>
<script>
    function setUrgingLine(data){
        var top="<li class=\"layui-timeline-item\">\n" +
            "            <i class=\"layui-icon layui-bg-blue layui-timeline-axis\">&#xe63f;</i>\n" +
            "            <div class=\"layui-timeline-content layui-text\">";
        var botton="</div>\n" +
            "        </li>\n" +
            "        <hr style='border: 1px dashed #4db0fd;height: 1px;margin: 0 15px 20px 10px'>";
        for(var i=0;i<data.length;i++){
            if(data[i].reviewContent=='null'||data[i].reviewContent==null){
                data[i].reviewContent='无'
            }
            var content=" <h3 class=\"layui-timeline-title\"><span>"+data[i].urgingDepartment+"</span>" +
                "<span style=\"margin-left: 10px\">"+data[i].urgingTime+"</span>" +
                "<span style=\"margin-left: 10px\">"+data[i].fullName+"("+data[i].roleName+")"+"</span></h3>\n" +
                "                <p><span style='color: #333'>催办内容:</span>" +
                data[i].urgingContent+
                "                </p></br>"+
                "                <p ><span style='color: #333'>回复内容:</span>" +
                data[i].reviewContent+
                "                </p>"
            var contentIsRes="";
            $("#timeline").append(top+content+contentIsRes+botton);
        }
        returnData();
    }

    function getParentData(parentData) {
        getUrging(parentData.processId)
    }

    function getUrging(processId) {
        $.ajax({
            url: mainUri+"/vurging/selectVUrgings",
            data: {processId:processId},
            type: "Post",
            dataType: "json",
            success: function (data) {
                $("#processCount").html(data.data.length)
                setUrgingLine(data.data)
            },
            error: function () {
                console.log("数据加载失败")
            }
        });
    }

    function returnData(inputData){
        var data={
            "height":$("#timeline").height()+150
        }
        $(window.parent.processReturnData(data));
    }



</script>

</html>